require File.dirname(__FILE__)+'/../lib/std_lib.rb'
require File.dirname(__FILE__)+'/../lib/reporting.rb'
require File.dirname(__FILE__)+'/../lib//testdata/testdata.rb'
require 'watir'
require 'watir/testcase'
require 'win32ole'
require File.dirname(__FILE__)+'/../lib/elements/Homepage/element_Homepage.rb'
require File.dirname(__FILE__)+'/../lib/elements/Accounts/element_Accounts.rb'
require File.dirname(__FILE__)+'/../lib/elements/Contacts/element_Contacts.rb'
#$ie = Watir::IE.attach(:title,/Service/)
#array = []
#array = $ie.select_list(:id,"PopupNewForm.ZPick_7").options
#puts array[1..-2].length
$ie = Watir::IE.attach(:title,/Accounts/)
#array = Element::CreateAccount.market_1_select_list.options
array = []
array = Element::CreateAccount.sub_market_1_select_list.options
puts array.length
def selection()


#How to definite the variable for part of ie

=begin
        $log.test_notes("Test OracleCRM")
        $log.test_notes("Start To Test ")
        for i in 1..2000
            OCRM_STD_LIB.login($product,$username,$password)
            t=Time.now.strftime("%m/%d %H:%M:%S")
            $log.test_notes(t)
            $log.test_notes("Round"+" "+i.to_s+t)
            $log.test_validate($ie.title.eql?("Home - Oracle CRM On Demand"), "Login Success o  not")

            #Element::Header_Link.sign_out.click
            sleep 60

            $ie.close
=end

#ai = WIN32OLE.new("AutoItX3.Control")
#ai.WinActivate("Search for an Account")
#ai.WinActivate("Home")
#full screen mode
#ai.MouseClick("right",573,90)
#window mode
#ai.MouseClick("right",983,350)
#ai.ControlSend("Search for an Account","","Internet Explorer_Server1","Tonytest")
#ai.ControlClick("Search for an Account","","Internet Explorer_Server1","[CLASS:Internet Explorer_Server;TEXT:Go;INSTANCE:1]")
#ai.ControlClick("Home","","Internet Explorer_Server1","[CLASS:Internet Explorer_Server;TEXT:Account;INSTANCE:1]")
#full screen mode
#ai.MouseClick("right",675,90)
#window mode
#ai.MouseClick("right",1077,350)

#$ie = ai Watir::IE.attach(:title,"Search for an Account")
#Element::HudPanel_Accounts.quotes_link.click
#$ie.image(:class,"popup").click

